package com.tutucms.common.javamail;

import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;

/**
 * Title:服务器邮箱登录验证
 * Description:cn.com.wxd.util.service.javamail
 * <p>
 * Company: Amumu管理平台
 * Copyright: Copyright (c) 2015
 * All right reserved.
 * Created time: 2016-4-8 下午3:08:08
 *
 * @author WangXuDong
 * @version 1.0
 */
public class MailAuthenticator extends Authenticator {
    private String username;
    private String password;

    /**
     * 初始化邮箱和密码
     *
     * @param username 用户名
     * @param password 密码
     */
    public MailAuthenticator(String username, String password) {
        this.username = username;
        this.password = password;
    }

    @Override
    protected PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication(username, password);
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

}
